package com.millstein.mapper;

import com.millstein.model.CouponRecordDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author millstein
 * @since 2021-09-14
 */
public interface CouponRecordMapper extends BaseMapper<CouponRecordDO> {

    /**
     * 批量更新这些优惠券的use_state字段
     * @param userId 用户id
     * @param useState 使用状态
     * @param lockedCouponRecordIds 锁定的优惠券记录id的结合
     * @return
     */
    int updateBatchUserState(@Param("userId") Long userId,
                             @Param("useState") String useState,
                             @Param("lockedCouponRecordIds") List<Long> lockedCouponRecordIds);
}
